import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect:'/index'
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index.vue'),
    children:[
      {
        path:'/index',
        redirect:'/profile'
      },
      {
        path: '/profile',
        name: 'User',
        component: () => import('../views/Index/User.vue')
      },
      {
        path: '/chart',
        name: 'Chart',
        component: () => import('../views/Index/Chart.vue')
      },
      {
        path:'/userMassage',
        name: 'UserMassage',
        component: () => import('../views/Index/UserMassage.vue')
      },
      {
        path:'/roleList',
        name: 'RoleList',
        component: () => import('../views/Index/RoleList.vue')
      },
      {
        path:'/permissionList',
        name: 'PermissionList',
        component: () => import('../views/Index/PermissionList.vue')
      },
      {
        path:'/articleRanking',
        name: 'ArticleRanking',
        component: () => import('../views/Index/ArticleRanking.vue')
      },
      {
        path:'/articleCreate',
        name: 'ArticleCreate',
        component: () => import('../views/Index/ArticleCreate.vue')
      },
      
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
